package com.weijin.bookborrowmanagesystem.service.impl;

import com.weijin.bookborrowmanagesystem.common.Result;
import com.weijin.bookborrowmanagesystem.mapper.UserMapper;
import com.weijin.bookborrowmanagesystem.pojo.User;
import com.weijin.bookborrowmanagesystem.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author WeiJin
 * @Version 1.0
 * @Date 2025/3/13 10:08
 */
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public Result<String> addUser(User user) {
        int insert = userMapper.insert(user);
        return insert > 0 ? Result.success("添加成功") : Result.failed("添加失败");
    }
}
